#ifndef __LOGO_LIB_P_H__
#define __LOGO_LIB_P_H__

#include <windows.h>
#include "logo_lib.h"

typedef struct tagBkPtNode {
	struct tagBkPtNode* next;
	unsigned int lineno;
} BkPtNode, *BkPtList;

typedef struct tagDebugControl 
{
   tagDebugControl();
   virtual ~tagDebugControl();

   unsigned int command;
   unsigned int lineno;
   bool         waitfornext;
   unsigned int calldepthsaved;
   unsigned int curlineno;
	BkPtList 	 breakpoints;
   /* this is only useful in STEP OVER and STEP TO
    *  when curlineno is in the breakpoint list.
    */   
   bool         executed;  
} DebugControl;

typedef struct tagExecControl {
   tagExecControl();
   virtual ~tagExecControl();
   bool            Aborted;
   bool            Paused;
   bool            Debug;
   unsigned long   ThreadID;
   /* DgbCtrl is accessed only by the logolib thread,
   *  no need to wait for gControlMutex; 
   */
   DebugControl    DbgCtrl;
} ExecControl;

#define GET_MUTEX(m)   \
    do {    \
        assert (m); \
        DWORD result = WaitForSingleObject (m, INFINITE); \
        if (result == WAIT_OBJECT_0) { 


#define REL_MUTEX(m)  \
        } \
        ReleaseMutex (m); \
    } while (0);

class rte_t;

bool get_abort (rte_t* rte);
unsigned long get_thread_id(rte_t* rte);
void get_debug_cmd(rte_t* rte);

#endif /* __LOGO_LIB_P_H__ */